<extend name="Base/agent"/>
<block name="content">
			<!--主体内容-->
			<div class="admin-main">
				<p class="current-title">客户信息</p>
				<p class="current-park"><i class="icon icon-index"></i><a href="#" class="current-index">首页</a> 〉〉 客户信息</p>
				<div class="current-condition">
					<input type="text" name="nickname" value="{:I('nickname')}" class="current-username current-click" placeholder="请输入用户名"/>
					<input type="text" name="mobile" value="{:I('mobile')}" class="current-tel current-click" placeholder="输入手机号码"/>
					<input type="text" name="agent" value="{:I('agent')}" class="current-broker current-click" placeholder="所属经纪人"/><br><br>
					<select class="yorn-broker" name="status" id="status">
						<option value="-2" <if condition="$status eq -2">selected</if>>是否是经纪人</option>
						<option value="1" <if condition="$status eq 1">selected</if>>是经纪人</option>
						<option value="2" <if condition="$status eq 2">selected</if>>不是经纪人</option>
					</select>
					<input type="text" name="start_time" value="{:I('start_time')}" class="current-stardate" placeholder="起始时间"/>
					<span style = "margin-left:-15px">至</span>
					<input type="text" name="end_time" value="{:I('end_time')}" class="current-stardate" placeholder="结束时间"/>
					<!-- <input type="text" class="current-enddate current-click" placeholder="结束时间"/> -->
					<input type="button" href="javascript:;" id="search" url="{:U('index')}" value="搜索" class="current-serach"/>

					<input type="reset" id="clear" value="清空" class="current-reset"/>
				</div>
				<!--数据表格-->
				<div class="main-table-data">
					<p class="table-title">所有顾客</p>
					<table class="current-table">
						<tr>
							<th>所属层级</th>
							<th>用户名</th>
							<th>经纪人</th>
							<th>手机号</th>
							<th>性别</th>
							<th>余额</th>
							<th>关注时间</th>
							<th>所属经纪人</th>
						</tr>
					  <foreach name="data" item="vo" key="k">
						<tr <if condition="$k%2!=0">class="table-bg"<else/>class="table-nobg"</if>>
							<td>{$vo.level}</td>
							<td>{$vo.nickname}</td>
							<td><if condition="$vo.is_agent eq 1">是<else/>否</if></td>
							<td>{$vo.mobile}</td>
							<td><if condition="$vo.sex eq 1">男<else/>女</if></td>
							<td>{$vo.money}</td>
							<td>{$vo.subscribe_time|date='Y-m-d',###}</td>
							<td>{$vo.agent}</td>
						</tr>
					  </foreach>
					</table>
					<!--分页-->
					<div class="current-page">
						{$_page}
					</div>
				</div>
				
			</div>
<script type="text/javascript">
    $("#search").click(function(){
        var url = $(this).attr('url');
        url = url.substr(0,url.lastIndexOf('.'));
        var query  = $('.current-condition').find('input').serialize();
        var status=$('#status').val();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
        query+="/status/"+status;
        query = query.replace(/=/gm,"/");
        query = query.replace(/&/gm,"/");
        if( url.indexOf('?')>0 ){
        	if(query.substr(0,1) != "/"){
        		url += "/"+query;
        	}else{
        		url += query;
        	}
        }else{
            url += "/" + query;
        }
        window.location.href = url;
    });
$("#clear").click(function(){
				window.location.href="{:U('AgentCustomer/index')}&state=-2";
			})

</script>			
</block>

